<template>
	<view class="login">
		<view class="head">
			<view class="title">
				<image src="../../static/img/tabbar/homeactive.png" mode=""></image>
				<text>注册您的AWE账号</text>
			</view>
			<view class="btn" @tap="goToLogin">去登录</view>
		</view>
		
		<view class="content">
			<view class="tabs">
				<view class="item" :class="{active: tabsIndex === index}" v-for="(item,index) in tabs" @tap="tabsToggl(index)">{{item}}</view>
			</view>
			<view class="form-box">
				<template v-if="tabsIndex === 0">
					<uni-forms class="login-form" ref="form" label-position="top">
						<uni-forms-item name="text" label="">
							<view class="login-zone" @tap="goto">
								中国 +86 <uni-icons type="arrowdown" size="18"></uni-icons>
							</view>
							<uni-easyinput class="input" type="text" :inputBorder="false" v-model="formData.text" placeholder="请输入您的手机号码"></uni-easyinput>
						</uni-forms-item>
					</uni-forms>
				</template>
				<template v-if="tabsIndex === 1">
					<uni-forms class="login-form" ref="form" label-position="top">
						<uni-forms-item name="mail" label="">
							<view class="login-zone">邮箱</view>
							<uni-easyinput class="input" type="mail" :inputBorder="false" v-model="formData.mail" placeholder="请输入您的邮箱"></uni-easyinput>
						</uni-forms-item>
					</uni-forms>
				</template>
				<view class="footer">
					<view class="checkbox">
						 <label><checkbox value="checkbox" />注册即代表您同意</label>
						 <navigator url="/" hover-stop-propagation>《用户协议》</navigator>和<navigator url="/" hover-stop-propagation>《隐私政策》</navigator>
					</view>
					<button type="primary" @tap="nextStep">下一步</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabsIndex: 0,
				tabs: ['手机注册', '邮箱注册'],
				formData: {},
				checkbox: false
			}
		},
		onNavigationBarButtonTap(e) {
			uni.navigateTo({
				url: "./login"
			})
		},
		methods: {
			// 跳转至索引列表列表
			goto() {
				uni.navigateTo({
					url: "../zoneIndexList/zoneIndexList"
				})
			},
			goToLogin() {
				uni.navigateTo({
					url: "./login"
				})
			},
			// 下一步
			nextStep() {
				uni.navigateTo({
					url: "./setPassword"
				})
			},
			// tabs 切换
			tabsToggl(e) {
				this.tabsIndex = e;
			}
		}
	}
</script>

<style>
	@import url("@/common/login.css");
</style>
